/*
 * @Description:
 * @Version: 2.0
 * @Autor: zhangjx
 * @Date: 2023-05-31 17:26:59
 * @LastEditors: uphldjx 1373577124@qq.com
 * @LastEditTime: 2024-06-04 19:43:35
 */
export const formConfig = {
	inline: false,
	showBtn: true,
	labelPosition: 'right',
	labelWidth: '100px',
	column: [
		{
			label: '所属行政单位',
			prop: 'organizationName',
			type: 'input',
			disabled: true,
			span: 24,
		},
		{
			label: '姓名',
			prop: 'realName',
			maxlength: '10',
			showWordLimit: true,
			type: 'text',
			span: 24,
			rules: [{ required: true, trigger: 'change', message: '请输入用户姓名' }],
		},
		{
			label: '证件类型',
			prop: 'idType',
			type: 'remoteSelect',
			code: 'ID_CARD_TYPE',
			api: 'getDictItemList',
			filterKey: 'value',
			dataType: 'number',
			multiple: false,
			span: 24,
			rules: [{ required: true, trigger: 'change', message: '请选择证件类型' }],
		},
		{
			label: '证件号码',
			prop: 'idNo',
			maxlength: '18',
			showWordLimit: true,
			type: 'text',
			rules: [{ required: true, trigger: 'change', message: '请输入证件号码' }],
			span: 24,
		},
		{
			label: '联系方式',
			prop: 'phone',
			maxlength: '11',
			showWordLimit: true,
			type: 'text',
			rules: [{ required: true, trigger: 'change', message: '请输入联系方式' }],
			span: 24,
		},
		{
			label: '用户角色',
			prop: 'roleList',
			type: 'remoteSelect',
			api: 'sys_role_page',
			filterKey: 'roleId',
			filterLabel: 'roleName',
			dataType: 'number',
			multiple: true,
			filterable: false,
			paramsObj: {
				classifyId: 3,
				pageParaPO:{
          size:1000
        }
			},
			span: 24,
			rules: [{ required: true, trigger: 'change', message: '请选择用户角色' }],
		},
		{
			label: '登录密码',
			prop: 'password',
			type: 'password',
			rules: [
				{
					pattern: /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\W]).{8,16}$/,
					message: '密码必须为8到16位同时包含大小写字母数字以及特殊符号的字符',
					trigger: 'blur',
				},
			],
			showPassword: true,
			span: 24,
		},
		{
			label: '上传照片',
			prop: 'avatar',
			type: 'upload',
			showFileList: false,
			limit: 1,
			multiple: false,
			span: 24,
		},
	],
}

export const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
  tableLayout:'auto',
	columns: [
		{ label: '姓名', prop: 'realName' },
		{ label: '用户名', prop: 'username' },
		{
			label: '角色',
			prop: 'roleName',
		},
		{ label: '联系方式', prop: 'phone' },
		{ label: '创建时间', prop: 'createTime' },
		{ label: '创建人', prop: 'creator' },
		{
			label: '状态',
			prop: 'lockFlag',
		},
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

export const searchConfig = {
	inline: true,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '用户名',
			prop: 'username',
			type: 'input',
			span: 8,
		},
		{
			label: '姓名',
			prop: 'realName',
			type: 'input',
			span: 8,
		},
		{
			label: '状态',
			prop: 'lockFlag',
			type: 'select',
			dicData: [
				{
					label: '正常',
					value: 0,
					type: 'success',
				},
				{
					label: '停用',
					value: 9,
					type: 'danger',
				},
			],
			span: 8,
		},
		{
			label: '角色',
			prop: 'roleName',
			type: 'input',
			span: 8,
		},
		{
			label: '联系方式',
			prop: 'phone',
			type: 'input',
			span: 8,
		},
		{
			label: '创建人',
			prop: 'creator',
			type: 'input',
			span: 8,
		},
	],
}
export const detailConfig = {
	inline: false,
	labelPosition: 'left',
	labelWidth: '100px',
	column: [
		{ label: '证件号', prop: 'idNo', span: 12 },
		{ label: '用户名', prop: 'username', span: 12 },
		{
			label: '用户状态',
			prop: 'lockFlag',
			span: 12,
			custome: 'tag',
			dicData: [
				{
					label: '有效',
					value: 0,
					type: 'success',
				},
				{
					label: '锁定',
					value: 9,
					type: 'danger',
				},
			],
		},
		{ label: '创建人', prop: 'creator', span: 12 },
		{ label: '创建时间', prop: 'createTime', span: 12 },
		{ label: '数据对接鉴权key', prop: '', span: 24 },
	],
	customeHeader: {
		type: 'CardTwo',
		title: 'realName',
		avatar: 'avatar',
		tipList: [{ prop: 'phone', type: 'tip-success', label: '联系电话' }],
		tagList: [
			{
				prop: 'roleName',
				custome: 'tag',
				type: 'success',
				label: '角色',
			},
			{ prop: 'userId', type: 'success', label: '用户编号' },
			{ prop: 'organizationName', type: 'success', label: '所属行政单位:' },
		],
		menuBtn: [],
	},
}
export const baseConfig = {
	pageName: '政务用户',
	dictcodes: ['ID_CARD_TYPE'],
	rowKey: 'userId',
	addLabel: '新建政务用户',
	tipLabel: 'realName',
	exportMqTopic: '/ning/export/',
	api: {
		index: 'sys_user_querypage',
		add: 'sys_user_add',
		edit: 'sys_user_edit',
		delete: 'sys_user_delete',
		export: 'sys_user_export',
	},
	auth: {
		index: 'sys_user_querypage',
		add: 'sys_user_add',
		edit: 'sys_user_edit',
		delete: 'sys_user_delete',
		mulitSet: 'mulitSet',
		export: 'sys_user_export',
	},
	menuBtn: [
		{
			icon: 'detail',
			label: '查看档案',
			type: 'primary',
			operate: 'detail',
			auth: 'sys_user_edit',
			text: true,
			show: true,
		},
		{
			icon: 'delete',
			label: '删除',
			type: 'danger',
			operate: 'delete',
			auth: 'sys_user_delete',
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '75%',
	},
	searchConfig,
	formConfig,
	tableConfig,
	detailConfig,
}
